<?php
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     block.formajax.php
 * Type:     formajax
 * Name:     formajax
 * Purpose:  Crea un formajax para afw
 * -------------------------------------------------------------
 */
function smarty_block_formajax($params, $content, &$smarty, &$repeat)
{
    if (isset($content)) {
        $id=$params['id'];
        $clase=$params['class'];
        $p=$params['p'];
        if($id==""){
        	$id="div" . date("Y-m-d-s") . rand();
        }
        $form="<form id='$id' onsubmit=\"enviarForm('$id', '$p'); return false;\" class='$clase'>";
        return $form . $content . "</form>";
    }
}
?> 